﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>企业文档</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta name="renderer" content="webkit">
    <link href="/CSS/bootstrap3.3.5/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="/CSS/V3/animate.css" rel="stylesheet">
    <link href="/CSS/V3/style.css?v=2.2.0" rel="stylesheet">
    <link href="/CSS/V3/BaseClassV3.css" rel="stylesheet">
    <script src="/Scripts/jquery-1.11.2.min.js"></script>
    <style>
        .folder-list li {
            padding: 5px;
        }
            .folder-list li i {
                color: gold;
            }
            .folder-list li:hover {
                background-color: #23c6c8;
                border-radius: 2px;
            }
        .foldersel {
            background-color: bisque;
        }
    </style>
</head>
<body ms-controller="APP_QYWD" class="gray-bg">

    <script type="avalon" id="tpllist">
        <i class="iconfont" ms-click="displist()" style="line-height: 34px;font-size: 20px;color:#3085DB;position:absolute; right:40PX" ms-class-1="icon-101:islist" ms-class-2="icon-liebiao:!islist"></i>
        <i ms-click="selall()" class="iconfont " ms-class-1="icon-weigouxuan:!isselall" ms-class-2="icon-gouxuan:isselall" style="font-size:20px;vertical-align: sub;position:absolute; line-height: 34px;margin-left:7px;"></i>
        <ol class="breadcrumb" style="margin-bottom:0;font-weight:bold;background-color:white;margin-left: 30px">
            <li ms-repeat-path="Pathdata" ms-class="active:path.active" ms-click="gopath(path)"><a href="#">{{path.Name}}</a></li>
        </ol>
        <ul class="listContent" ms-if="islist">
            <li class="lifile hvr-float-shadow" ms-repeat-item="ListData" ms-class-1="selli:item.issel" ms-on-mousedown="filecontextmenu(item,event)" data-repeat-rendered="filechange" ms-on-dblclick="viewitem(item,$(this))" ms-attr-title="item.CRDate">
                <span class="badge newbadge" ms-if="ComFunJS.daysBetween(ComFunJS.getnowdate('yyyy-mm-dd'), item.CRDate.substring(0,10)) == 0||ComFunJS.daysBetween(ComFunJS.getnowdate('yyyy-mm-dd'), item.CRDate.substring(0,10)) == -1">新</span>
                <i ms-click="selItems(item,event)" class="iconfont" ms-class-1="icon-weigouxuan:!item.issel" ms-class-2="icon-gouxuan:item.issel"></i>
                <img class="fileimg" ms-attr-itemid="item.ID" ms-attr-src="getsrc(item)"  onerror="javascript: this.src = '/images/NewIndex/qywd/file.png'">
                <!--ms-class-1="copy:(PasteData>0&&PasteData[0].copycutid==item.ID)"-->
                <span class="link-logo" ms-if="item.ShareCode||item.ViewAuthUsers||item.DownloadAuthUsers||item.UploadaAuthUsers"></span>
                <span>
                    <i class=" iconfont icon-xitongshoucang" ms-if="item.CollectUser.indexOf(nowuser) >= 0" style="font-size:12px;"></i>
                    <input type="text" ms-click="selItem(item,event)" ms-attr-itemid="item.ID" ms-attr-value="item.Name" style="width:70px;border:0;background-color:transparent; margin-top:0;display:none" ms-on-blur="updatename(item,$(this))" />
                    <a href="#" ms-click="viewitem(item)">{{item.Name}}</a>
                </span>
            </li>
        </ul>
        <table class="table table-hover listContent" ms-if="!islist">
            <thead>
                <tr>
                    <th>&nbsp;&nbsp;文件名</th>
                    <th></th>
                    <th>大小</th>
                    <th>格式</th>
                    <th>最后修改时间</th>
                </tr>
            </thead>
            <tbody>
                <tr class="lifile" ms-repeat-item="ListData" ms-class-1="selli:item.issel" ms-on-mousedown="filecontextmenu(item,event)" data-repeat-rendered="filechange" ms-on-dblclick="viewitem(item)">
                    <td>
                        <i ms-click="selItems(item,event)" class="iconfont" ms-class-1="icon-weigouxuan:!item.issel" ms-class-2="icon-gouxuan:item.issel" style="font-size:18px;vertical-align: sub;"></i>&nbsp;&nbsp;
                        <!--<img class="fileimg" style="width:35px;height:30px;margin-left:5px" ms-attr-itemid="item.ID" ms-attr-src="/images/NewIndex/qywd/{{item.type=='folder'?'file1':item.FileExtendName}}.png" onerror="javascript: this.src = '/images/NewIndex/qywd/file.png'">-->
                        <img class="fileimg" style="width:35px;height:30px;margin-left:5px" ms-attr-itemid="item.ID" ms-attr-src="getsrc(item)" onerror="javascript: this.src = '/images/NewIndex/qywd/file.png'">
                        <span style="margin-left:5px">
                            <input type="text" ms-click="selItem(item,event)" ms-attr-itemid="item.ID" ms-attr-value="item.Name" style="border:0;background-color:transparent; margin-top:5px;width:250px;display:none" ms-on-blur="updatename(item,$(this))" />
                            <a href="#" ms-click="viewitem(item)">{{item.Name}}.{{item.FileExtendName}}</a>
                        </span>
                    </td>
                    <td style="width: 80px; vertical-align: middle;">
                        <i class="iconfont icon-xitongshoucang" ms-if="item.CollectUser.indexOf(nowuser) >= 0" style="font-size:16px; " title="已收藏"></i>
                        <i class="iconfont icon-yulan " ms-if="item.ISYL" style="font-size:16px;" title="预览"></i>
                    </td>
                    <td style="width: 80px; vertical-align: middle;">{{ComFunJS.converfilesize(item.FileSize)}}</td>
                    <td style=" vertical-align: middle;">{{item.FileExtendName}}</td>
                    <td style="width: 160px; vertical-align: middle;">{{item.CRDate}}</td>
                </tr>
            </tbody>
        </table>
    </script>
    <script type="avalon" id="querylist">
        <ol class="breadcrumb" style="margin-bottom:0;font-weight:bold;background-color:white">
            <li ms-click="GetListData(rootpath)"><a href="#">全部</a></li>
            <li>搜索：{{searchkey}}</li>
        </ol>
        <ul class="listContent">
            <li class="lifile hvr-float-shadow" ms-repeat-item="ListData" ms-class-1="selli:item.issel" ms-on-mousedown="filecontextmenu(item,event)" data-repeat-rendered="filechange" ms-on-dblclick="viewitem(item,$(this))" ms-attr-title="item.CRDate">
                <i ms-click="selItems(item,event)" class="fa" ms-class-1="fa-square-o:!item.issel" ms-class-2="fa-check-square:item.issel"></i>
                <img class="fileimg" ms-attr-itemid="item.ID" ms-attr-src="/images/NewIndex/qywd/{{item.type=='folder'?'file1':item.FileExtendName}}.png" onerror="javascript: this.src = '/images/NewIndex/qywd/file.png'">
                <span class="link-logo" ms-if="item.ShareCode||item.ViewAuthUsers||item.DownloadAuthUsers||item.UploadaAuthUsers"></span>
                <i class="fa fa-heart" ms-if="item.CollectUser.indexOf(nowuser) >= 0" style="font-size:12px;  line-height: 30px;"></i>
                <input type="text" ms-click="selItem(item,event)" ms-attr-itemid="item.ID" ms-attr-value="item.Name" style="width:70px;border:0;background-color:transparent; margin-top:5px;display:none" ms-on-blur="updatename(item,$(this))" />
                <a href="#" ms-click="selItem(item,event)">{{item.Name}}</a>
            </li>
        </ul>
    </script>
    <div class="row wrapper wrapper-content animated fadeInRight">
        <div class="col-sm-3">
            <script type="avalon" id="tmpltree">
                <ul class="treeul">
                    <li ms-repeat-folder="folder.SubFolder"><span class="spanli" ms-click="folderclick(folder,this)"> <i class="iconfont icon-iconwenjianjia"></i><span class="spanwz">{{folder.Name}}</span></span><div ms-include="'tmpltree'" style="display:none"></div></li>
                    <li ms-repeat-file="folder.SubFileS"><span class="spanli"> <img class="treefile" ms-attr-src="/images/NewIndex/qywd/{{file.FileExtendName}}.png" onerror="javascript: this.src = '/images/NewIndex/qywd/file.png'" /><span class="spanwz">{{ComFunJS.convstr(file.Name,10)}}</span></span></li>
                </ul>
            </script>

            <div class="panel-body mainbody" style="overflow: auto">
                <a href="#" ms-click="GetListData(rootpath)"><h3>{{rootpath=="1"?"企业资料库":"个人文档"}}</h3></a>
                <ul style="padding-left: 10px;" class="treeul">
                    <li ms-repeat-folder="treefilelist.SubFolder">
                        <span class="spanli" ms-click="folderclick(folder,this)"><i class="iconfont icon-iconwenjianjia"></i><span class="spanwz">{{folder.Name}}</span></span>
                        <div ms-include="'tmpltree'" style="display: none"></div>
                    </li>
                    <li ms-repeat-file="treefilelist.SubFileS">
                        <span class="spanli">
                            <img class="treefile" ms-attr-src="/images/NewIndex/qywd/{{file.FileExtendName}}.png" onerror="javascript: this.src = '/images/NewIndex/qywd/file.png'" /><span class="spanwz">{{ComFunJS.convstr(file.Name,10)}}</span>
                        </span>
                    </li>
                </ul>
            </div>
        </div>
        <div class="col-sm-9">

            <div class="panel-default panel" style="border:0">
                <div class="panel-heading" style="BACKGROUND-COLOR: WHITE;border-bottom: 0;padding-left:7px">
                    <h2 style="margin-top:0">
                        {{rootpath=="1"?"企业资料库":"个人文档"}}
                    </h2>
                    <div class="row" style="margin-top:15px">
                        <div class="col-xs-9">
                            <div class="btn-group" role="group">
                                <button type="button" ms-attr-disabled="viewkey!='tpllist'" ms-click="addFile()" class="btn btn-info"><i class="iconfont icon-shangchuan"></i>&nbsp;上传文件</button>
                                <button type="button" ms-attr-disabled="viewkey!='tpllist'" id="conaddfolder" class="btn btn-white" data-toggle="modal" data-target="#UpdateNameModal"><i class="iconfont icon-tianjiawenjianjia"></i>&nbsp;新建文件夹</button>
                            </div>
                            <div class="btn-group" role="group" ms-if="SelItemData.size()>0" style="margin-left:10px">
                                <button type="button" class="btn btn-white " ms-click="downloaditem()"><i class="iconfont icon-xiazai"></i>&nbsp;下载</button>
                                <button type="button" class="btn btn-white " ms-click="copycutdata('copy')"><i class="iconfont icon-fuzhi"></i>&nbsp;复制</button>
                                <button type="button" class="btn btn-white " ms-click="copycutdata('cut')"><i class="iconfont icon-iconfontjianqie"></i>&nbsp;剪切</button>
                                <button type="button" class="btn btn-danger " ms-click="delitems()"><i class="iconfont icon-icondelete"></i>&nbsp;删除</button>
                            </div>
                            <div class="btn-group" role="group" ms-if="SelItemData.size()==1" style="margin-left:10px">
                                <button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                    <i class="iconfont icon-fenxiang"></i>分享<span class="caret"></span>
                                    <span class="sr-only"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li ms-click="ShareItem()"><a href="#">外部分享</a></li>
                                    <li ms-click="SetAuth()"><a href="#">内部共享</a></li>
                                </ul>
                            </div>
                        </div>
                        <div class="col-xs-3 text-right">
                            <div class="input-group">
                                <input type="text" ms-keypress="jptjsearch(event)" class="form-control" ms-duplex="searchkey" placeholder="输入文件名或后缀,按CTRL+ENTER键搜索">
                                <span class="input-group-btn">
                                    <button class="btn btn-white" type="button" ms-click="searchfile()">搜索</button>
                                    <button class="btn btn-danger" ms-if="searchkey.length>0" type="button" ms-click="clearsearch()">清除</button>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel-body wdlist" ms-include="viewkey" data-include-rendered='listrender' style="min-height:450px;padding:10px 0 10px 0; overflow-y:auto">
                </div>
                <div class="panel-footer text-right no-borders" style="background-color:transparent">
                    <span>  共包含{{ListData.size()}}项</span>
                </div>
            </div>
        </div>
        <div id="context-menu" class="conMenu" ms-visible="SelItemData.size()==1">
            <ul class="dropdown-menu" role="menu">
                <li><a href="#">&nbsp;下载</a></li>
                <li><a href="#">&nbsp;重命名</a></li>
                <li><a href="#">&nbsp;复制</a></li>
                <li><a href="#">&nbsp;剪切</a></li>
                <li><a href="#">&nbsp;删除</a></li>
                <li role="separator" class="divider"></li>
                <li ms-visible="!menuattr.issc"><a href="#">&nbsp;收藏</a></li>
                <li style="background-color:antiquewhite" ms-visible="menuattr.issc"><a href="#">&nbsp;取消收藏</a></li>
                <li ms-class-1="active:menuattr.isfx"><a href="#">&nbsp;外部分享</a></li>
                <li ms-class-1="active:menuattr.isgx"><a href="#">&nbsp;内部共享</a></li>
                <li role="separator" class="divider"></li>
                <li><a href="#">&nbsp;&nbsp;属性</a></li>
            </ul>
        </div>
        <div id="context-menu1" class="conMenu" ms-if="viewkey=='tpllist'">
            <ul class="dropdown-menu" role="menu">
                <li data-toggle="modal" data-target="#UpdateNameModal"><a href="#">新建文件夹</a></li>
                <li><a href="#">上传文件</a></li>
                <li ms-class="disabled:PasteData.size()==0"><a href="#">粘贴</a></li>
            </ul>
        </div>
        <div class="modal fade" id="UpdateNameModal" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">新建文件夹</h4>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <input type="text" class="form-control" autofocus="autofocus" id="conname" ms-keypress="jptj(event,$(this))" placeholder="此处输入文件夹名称,按下CRRL+ENTER即可" />
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-success" id="conaddForder" ms-click="addfolder(this)"><i class="fa fa-spinner fa-spin" style="display:none"></i> 确&nbsp;&nbsp;认</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="/Scripts/avalon1.5.js"></script>


    <script src="/Scripts/SZHLCommon.js?jsver=5"></script>
    <script src="/Scripts/contextmenu.js"></script>
    <script src="/CSS/bootstrap3.3.5/js/bootstrap.min.js"></script>
    <script>
        var rootpath = ComFunJS.getQueryString("root") ? ComFunJS.getQueryString("root") : 2;
        avalon.ready(function () {
            ComFunJS.initsetajax();
            model.GetListData(rootpath);
            model.GetTreeData(model.treefilelist);
            $(".wdlist").contextmenu({
                target: '#context-menu1',
                before: function (e, context) {
                    // execute code before context menu if shown
                    $("#context-menu").hide();

                    return true;
                },
                onItem: function (context, e) {
                    var itemid = $(context).attr("itemid");
                    var action = $.trim($(e.target).text());
                    switch (action) {
                        case "新建文件夹":
                            $("#conaddfolder").trigger('click')
                            break;
                        case "上传文件":
                            model.addFile();
                            break;
                        case "粘贴":
                            model.pasteitem();
                            break;
                        default:
                    }
                }
            });
        })
    </script>

    <script src="/ViewV3/APPBaseView/QYWD/avalfile.js?jsver=5"></script>
</body>
</html>
